<template>
  <div class="m-l-2">
    <el-tabs v-model="activeName">
      <el-tab-pane label="任务" name="task"/>
      <el-tab-pane label="接听信息" name="detail"/>
    </el-tabs>
    <Task v-if="activeName === 'task'" @openDetail="detailHandle"/>
    <Detail ref="detailRef" v-if="activeName === 'detail'"/>
  </div>
</template>

<script setup>

import Task from "./task/Task.vue";
import Detail from "./detail/Detail.vue";

const activeName = ref("task");
const detailRef = ref();

const detailHandle = function (taskData) {
  activeName.value = "detail";
  nextTick(() => {
    detailRef.value?.initData(taskData);
  });

}
</script>


<style scoped>


</style>
